package oss

type Owner struct {
	ID          string
	DisplayName string
}

type Bucket struct {
	Location     string
	Name         string
	CreationDate string
}

type Buckets struct {
	Buckets []Bucket `xml:"Bucket"`
}

type ListAllMyBucketsResult struct {
	Owner   Owner
	Buckets Buckets
}

type CreateBucketConfiguration struct {
	LocationConstraint string
}

type Error struct {
	Code          string
	Message       string
	ArgumentValue string
	ArgumentName  string
	RequestId     string
	HostId        string
}

type BucketLoggingStatus struct {
	LoggingEnabled LoggingEnabled `xml:"LoggingEnabled,omitempty"`
}

type IndexDocument struct {
	Suffix string
}

type ErrorDocument struct {
	Key string
}

type WebsiteConfiguration struct {
	IndexDocument IndexDocument
	ErrorDocument ErrorDocument
}

type ReferrerConfiguration struct {
	AllowEmptyReferrer bool `xml: AllowEmptyReferer`
	RefererList        struct {
		Referrer []string `xml:"Referer"`
	}
}

type Expiration struct {
	Days int    `xml:"Days,omitempty"`
	Date string `xml:"Date,omitempty"`
}

type Rule struct {
	ID         string
	Prefix     string
	Status     string
	Expiration Expiration
}

type LifecycleConfiguration struct {
	Rule []Rule `xml:"Rule"`
}

type Contents struct {
	Key          string
	LastModified string
	ETag         string
	Type         string
	Size         string
	StorageClass string
	Owner        Owner
}

//
//type Delimiter struct {
//	IsTruncated string
//	Contents    []Contents `xml:Contents"`
//}

type ListBucketResult struct {
	Name        string
	Prefix      string
	Marker      string
	MaxKeys     string
	Delimiter   string
	IsTruncated string
	Contents    []Contents `xml:Contents"`
}

type AccessControlList struct {
	Grant string
}

type AccessControlPolicy struct {
	Owner             Owner
	AccessControlList AccessControlList
}

type LocationConstraint string

type LoggingEnabled struct {
	TargetBucket string
	TargetPrefix string
}

type CopyObjectResult struct {
	LastModified string
	ETag         string
}

type Object struct {
	Key string
}

type Delete struct {
	Quiet  string
	Object []Object `xml:Object`
}

type Deleted struct {
	Key string
}

type DeleteResult struct {
	Deleted Deleted
}

type InitiateMultipartUploadResult struct {
	Bucket   string
	Key      string
	UploadId string
}

type CopyPartResult struct {
	LastModified string
	ETag         string
}

type CompleteMultipartUpload struct {
	Part []Part `xml:"Part"`
}

type CompleteMultipartUploadResult struct {
	Location string
	Bucket   string
	Key      string
	ETag     string
}

type MultipartPostResponse struct {
	Bucket   string
	ETag     string
	Location string
}

type Upload struct {
	Key       string
	UploadId  string
	Initiated string
}

type ListMultipartUploadsResult struct {
	Bucket             string
	KeyMarker          string
	UploadIdMarker     string
	NextKeyMarker      string
	NextUploadIdMarker string
	Delimiter          string
	Prefix             string
	MaxUploads         string
	IsTruncated        string
	Upload             []Upload `xml:"Upload"`
}

type Part struct {
	PartNumber   string
	LastModified string
	ETag         string
	Size         string
}

type ListPartsResult struct {
	Bucket               string
	Key                  string
	UploadId             string
	NextPartNumberMarker string
	MaxParts             string
	IsTruncated          string
	Part                 []Part `xml:"Part"`
}

type CORSRule struct {
	AllowedOrigin []string `xml:"AllowedOrigin"`
	AllowedMethod []string
	AllowedHeader []string
	ExposeHeader  []string
	MaxAgeSeconds string
}

type CORSConfiguration struct {
	CORSRule []CORSRule `xml:"CORSRule"`
}

type OssCallback struct {
	Url      string
	Host     string
	Body     string
	BodyType string
	Fields   map[string]string // key必须以x:开头
}
